/**
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.nhncorp.neptune.testjob.tera;

import java.io.IOException;

/**
 * Tera byte 이상의 데이터를 neptune upload 하는 테스트 프로그램
 * Map only로 수행되며 map에서 task id를 이용하여 자신이 입력할 rowkey의 range를 결정하여
 * BatchUploader를 이용하여 업로딩한다.
 * @author nhn
 *
 */
public class TeraJob {
  public static void main(String[] args) throws IOException {
    if(args.length < 6) {
      System.out.println("Usage: java TeraJob <online|batch> <table name> <# tablets> <row data length> <total data(GB)> <neptune_home_dir>");
      System.exit(0);
    }
    
    if("batch".equals(args[0])) {
      TeraBatchUploadJob job = new TeraBatchUploadJob();
      job.runJob(args[1], Integer.parseInt(args[2]), Integer.parseInt(args[3]), Integer.parseInt(args[4]), args[5]);
    } else if("online".equals(args[0])) {
      TeraOnlineJob job = new TeraOnlineJob();
      job.runJob(args[1], Integer.parseInt(args[2]), Integer.parseInt(args[3]), Integer.parseInt(args[4]), args[5]);
    } else {
      System.out.println("Usage: java TeraJob <online|batch> <table name> <# tablets> <row data length> <total data(GB)>");
      System.exit(0);
    }
  }
}
